#include "../includes/FileApi.h"
#include "../includes/DiskManager.h"
#include <vector>
#include <string>

int main(){
    std::string disk_file_path = "/home/ubuntu/FileSysSimulate/file-sys-simulate/disk_file"; // 用于模拟磁盘的文件路径
    DiskManager::getInstance(disk_file_path);
    DiskManager::SuperBlock super_block;
    DiskManager& disk_manager = DiskManager::getInstance();
    disk_manager.super_block_load(super_block);
    std::vector<std::string> files;
    for(int i = 0; i < INODE_NUM; i++){
        if(super_block.inode_state[i]){
            DiskManager::Inode inode;
            disk_manager.inode_get(i, inode);
            files.push_back(inode.path);
        }
    }
    for(auto file: files)std::cout << file << '\n';
    return 0;
}